﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace TroTro
{
    class Timing
    {
        private Game _game;
        private SpriteFont _font;
        private int _startTick;

        public Timing(Game game, int startTick)
        {
            _game = game;
            _startTick = startTick;
            LoadContent();
        }

        private void LoadContent()
        {
            _font = _game.Content.Load<SpriteFont>(@"sprites\scoreFont");
        }

        private String BuildString()
        {
            return Convert.ToString(String.Concat(((Environment.TickCount/1000) - (_startTick/1000))));
        }

        public void Draw(SpriteBatch spriteBatch)
        {
            spriteBatch.DrawString(_font, BuildString(), new Vector2(_game.GraphicsDevice.Viewport.Width - 100, 10), Color.White);
        }
    }
}
